*==========================================================================================================================================================================================
*Date  : July, 2025
*Paper : The Impact of Subsidy on EV Adoption: A Case from China
*Author: Xiaoying Yang, Kingsley Dogah, Bo Jiang, Bozhen Liu
*==========================================================================================================================================================================================

use data_EV.dta, clear

**# // table 5: Baseline Results for ln(EV share)

xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec EduExpR_city EnvExpR i.T, vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec EduExpR_city EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec EduExpR_city EnvExpR LicR DR_di i.T, fe vce(cluster CityID)



**# // table 6: DID Results for ln(EV share)

preserve

xtreg lgPt did treat17 Post17 i.T, fe vce(cluster CityID)
xtreg lgPt did GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)

drop if T>707
xtreg lgPt did treat17 Post17 i.T, fe vce(cluster CityID)
xtreg lgPt did GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)

drop if T>695
xtreg lgPt did treat17 Post17 i.T, fe vce(cluster CityID)
xtreg lgPt did GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)

restore


**# // table 7: Heterogeneous Effects for ln(EV share)

xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.Sub_update#c.EduExpR_city i.T, fe vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.Sub_update#c.EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.Sub_update#Tier i.T, fe vce(cluster CityID)


**# // table 8: Results for ln(BEV share)

xtreg lgPt SubEV_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt SubEV_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.SubEV_update#c.EduExpR_city i.T, fe vce(cluster CityID)
xtreg lgPt SubEV_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.SubEV_update#c.EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt SubEV_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.SubEV_update#Tier i.T, fe vce(cluster CityID)


**# // table 9: Dummy for Local Subsidy, ln(EV share)

xtreg lgPt d_sub GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt d_sub GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.d_sub#c.EduExpR_city i.T, fe vce(cluster CityID)
xtreg lgPt d_sub GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.d_sub#c.EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt d_sub GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.d_sub#Tier  i.T, fe vce(cluster CityID)


**# // table 10: Quarterly Data, ln(EV share)

preserve

gen qdate=qofd(dofm(T))
format qdate %tq

collapse (mean) Pt GDP_1000 ChrgPt_1000 EduExpR_city EnvExpR Tier Pop Land GasAdj_L Electricity (max) Sub_update LicR EduExpR_city DR_di, by(CityID qdate)

gen den=Pop/Land
gen Gas_Elec=GasAdj_L/Electricity
gen lgPt=log(Pt)


xtset CityID qdate

xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.qdate, fe vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.Sub_update#c.EduExpR_city i.qdate, fe vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.Sub_update#c.EnvExpR i.qdate, fe vce(cluster CityID)
xtreg lgPt Sub_update GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR c.Sub_update#Tier i.qdate, fe vce(cluster CityID)

restore


**# // table 11: DID Results for ln(EV share), Using Treatment Intensity

xtreg lgPt intensity treat_in Post17 i.T, fe vce(cluster CityID)
xtreg lgPt intensity GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt intensity GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T Tier#c.intensity, fe vce(cluster CityID)

drop if T>707
xtreg lgPt intensity treat17 Post17 i.T, fe vce(cluster CityID)
xtreg lgPt intensity GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt intensity GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T Tier#c.intensity, fe vce(cluster CityID)

drop if T>695
xtreg lgPt intensity treat_in Post17 i.T, fe vce(cluster CityID)
xtreg lgPt intensity GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt intensity GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T Tier#c.intensity, fe vce(cluster CityID)


**# // table 12: Placebo DID Results for ln(EV share)

preserve
drop  if ChrgPt_1000==. | EduExpR_city==.

xtreg lgPt did19 treat17 Post19 i.T, fe vce(cluster CityID)
xtreg lgPt did19 treat17 Post19 GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt did18 treat17 Post18 i.T, fe vce(cluster CityID)
xtreg lgPt did18 GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt did18 GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T Tier#c.did18, fe vce(cluster CityID)

drop if yr==2016 | yr==2019
xtreg lgPt did18 treat17 Post18 i.T, fe vce(cluster CityID)
xtreg lgPt did18 GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T, fe vce(cluster CityID)
xtreg lgPt did18 GDP_1000 den ChrgPt_1000 Gas_Elec LicR EduExpR_city DR_di EnvExpR i.T Tier#c.did18, fe vce(cluster CityID)

restore


